home *** CD-ROM | disk | FTP | other *** search
/ Ozsi 10 / Ozsi_10_1998_Tide_Side_C.d64 / program merge (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  981b  |  49 lines

  1. 90 poke53280,1:poke53281,1:print"[147]"
  2. 95 printspc(13)"hills 64 group"
  3. 100 printspc(13)"program merger"
  4. 110 dim a$(2),b$(2),c$(2),n(2)
  5. 120 open 15,8,15
  6. 130 input"program 1";x$
  7. 140 open1,8,2,x$+",p,r"
  8. 150 input#15,e,e$,e1,e2
  9. 160 if e then print e$:close15:end
  10. 170 get#1,a$,a$:j=1:gosub420
  11. 180 input"program 2 (or 'n')";x$
  12. 190 if x$="n" then n(2)=1e9:goto240
  13. 200 open2,8,3,x$+",p,r"
  14. 210 input#15,e,e$,e1,e2
  15. 220 if e then print e$:close15:end
  16. 230 get#2,a$,a$:j=2:gosub420
  17. 240 input"new file";x$
  18. 250 open8,8,8,"0:"+x$+",p,w"
  19. 260 input#15,e,e$,e1,e2
  20. 270 if e then print e$:close 15:end
  21. 280 print#8,chr$(1);chr$(4);
  22. 290 rem compare the lines here
  23. 300 x=2
  24. 310 ifn(1)<n(2)thenx=1
  25. 320 n=n(x):ifn>1e8then380
  26. 330 print#8,chr$(1);chr$(1);a$(x);b$(x);c$(x);chr$(0);
  27. 340 forj=1to2
  28. 350 if n(j)=n then gosub420
  29. 360 next j
  30. 370 goto300
  31. 380 print#8,chr$(0);chr$(0);
  32. 390 close1:close2:close8:close15
  33. 400 end
  34. 410 rem read line of basic
  35. 420 get#j,a$,b$
  36. 430 ifa$=""andb$=""then540
  37. 440 get#j,a$(j),b$(j)
  38. 450 ifa$(j)=""thena$(j)=chr$(0)
  39. 460 ifb$(j)=""thenb$(j)=chr$(0)
  40. 470 n(j)=asc(a$(j))+asc(b$(j))*256
  41. 480 c$(j)=""
  42. 490 get#j,a$
  43. 500 ifa$=""then550
  44. 510 c$(j)=c$(j)+a$
  45. 520 ifst=0andlen(c$(j))<254then490
  46. 530 print"problem file ";j
  47. 540 n(j)=1e9
  48. 550 return
  49.